﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Touch2Like.DAL;
using Touch2Like.Model;
using Touch2Like.SharedLibrary;
using System.Configuration;
using System.Data;

namespace Touch2Like.Web.Product
{
    public partial class CartNext : System.Web.UI.Page
    {
//        public OrderInfo orderInfo = null;

//        protected void Page_Load(object sender, EventArgs e)
//        {
//            if (WebUtility.UserGUID == "0")
//            {
//                Response.Redirect("/Customer/signin.aspx?next=" + Server.UrlEncode("/goods/CartNext.aspx?orderid=" + Request["orderid"]));
//            }

//            if (!string.IsNullOrEmpty(Request["tempuserid"]))
//            {
//                Touch2Like.DAL.UserDAL user = new Touch2Like.DAL.UserDAL();
//                //user.UpdateUserData(Convert.ToInt32(Request["tempuserid"]), WebUtility.UserGUID);
//            }

//            this.Master.CurrentPage = "NFCStore";

//            OrderDAL order = new OrderDAL();
//            orderInfo = order.GetByID(Convert.ToInt32(Utility.Encryption.Decrypt(Request["orderid"])));

//            if (orderInfo != null)
//            {
//                lb_OrderPrice.Text = orderInfo.TotalPrice.ToString();

//                ShoppingCartDAL cart = new ShoppingCartDAL();
//                Repeater_Tags.DataSource = cart.GetByOrderNumber(orderInfo.OrderNumber);
//                Repeater_Tags.DataBind();
//            }

//            if (!IsPostBack)
//            {
//                //CommonAddress address = new CommonAddress();
//                //DataTable dtAddress = address.GetByUserID(WebUtility.UserGUID);
//                //dtAddress.Rows.InsertAt(dtAddress.NewRow(), 0);

//                //ddl_CommonAddress.DataTextField = "Address";
//                //ddl_CommonAddress.DataValueField = "ListID";
//                //ddl_CommonAddress.DataSource = dtAddress;
//                //ddl_CommonAddress.DataBind();c
//            }
//        }

//        protected void btn_Continue_Click(object sender, EventArgs e)
//        {
//            if (cb_Copy.Checked)
//            {
//                tb_FirstName.Text = tb_BFirstName.Text.Trim();
//                tb_LastName.Text = tb_BLastName.Text.Trim();
//                tb_Company.Text = tb_BCompany.Text.Trim();
//                tb_Address.Text = tb_BAddress.Text.Trim();
//                tb_Address2.Text = tb_BAddress2.Text.Trim();
//                tb_City.Text = tb_BCity.Text.Trim();
//                tb_Postal.Text = tb_BPostal.Text.Trim();
//                ddl_Country.SelectedValue = ddl_BCountry.SelectedValue;
//                ddl_State.SelectedValue = ddl_BState.SelectedValue;
//                tb_Phone.Text = tb_BPhone.Text.Trim();
//            }

//            ShippingAddressDAL ship = new ShippingAddressDAL();
//            ShippingAddressInfo shipInfo = new ShippingAddressInfo();

//            shipInfo.Email = tb_Email.Text.Trim();
//            shipInfo.FirstName = tb_FirstName.Text.Trim();
//            shipInfo.LastName = tb_LastName.Text.Trim();
//            shipInfo.Company = tb_Company.Text.Trim();
//            shipInfo.Address = tb_Address.Text.Trim();
//            shipInfo.Address2 = tb_Address2.Text.Trim();
//            shipInfo.City = tb_City.Text.Trim();
//            shipInfo.Postal = tb_Postal.Text.Trim();
//            shipInfo.Country = ddl_Country.SelectedValue.Trim();
//            shipInfo.State = ddl_State.SelectedValue.Trim();
//            shipInfo.Phone = tb_Phone.Text.Trim();
//            shipInfo.OrderID = Convert.ToInt32(Utility.Encryption.Decrypt(Request["orderid"]));

//            ship.Add(shipInfo);

//        }

//        protected void ddl_CommonAddress_SelectedIndexChanged(object sender, EventArgs e)
//        {
//            CommonAddress address = new CommonAddress();
//            if (ddl_CommonAddress.SelectedValue != "")
//            {
//                CommonAddressInfo addressInfo = address.GetByID(Convert.ToInt32(ddl_CommonAddress.SelectedValue));

//                if (addressInfo != null)
//                {
//                    tb_FirstName.Text = addressInfo.FirstName;
//                    tb_LastName.Text = addressInfo.LastName;
//                    tb_Company.Text = addressInfo.Company;
//                    tb_Address.Text = addressInfo.Address;
//                    tb_Address2.Text = addressInfo.Address2;
//                    tb_City.Text = addressInfo.City;
//                    tb_Postal.Text = addressInfo.Postal;
//                    ddl_Country.SelectedValue = addressInfo.Country;
//                    ddl_State.SelectedValue = addressInfo.State;
//                    tb_Phone.Text = addressInfo.Phone;

//                    tb_BFirstName.Text = addressInfo.FirstName;
//                    tb_BLastName.Text = addressInfo.LastName;
//                    tb_BCompany.Text = addressInfo.Company;
//                    tb_BAddress.Text = addressInfo.Address;
//                    tb_BAddress2.Text = addressInfo.Address2;
//                    tb_BCity.Text = addressInfo.City;
//                    tb_BPostal.Text = addressInfo.Postal;
//                    ddl_BCountry.SelectedValue = addressInfo.Country;
//                    ddl_BState.SelectedValue = addressInfo.State;
//                    tb_BPhone.Text = addressInfo.Phone;

//                    tb_Email.Text = addressInfo.Email;
//                }
//            }
//        }
    }
}